<template>
  <div class="fixed">
    <div class="top">
      <span @click="close">
        <svg-icon icon-class="back" class="icon" />
      </span>
      <span class="center">所有银行</span>
    </div>
    <div class="recharge">
      <span>充值金额：</span>
      <span>￥10000.00</span>
      <span>快速复制</span>
    </div>
    <div class="info">
      <p>收款信息</p>
      <img src="../../../assets/images/info.png" />
    </div>
    <van-form @submit="onSubmit">
      <van-field
        v-model="form.name"
        name="name"
        label="收款人"
        placeholder="填写收款人"
        :rules="[{ required: true, message: '请填写银行卡姓名' }]"
      >
        <van-button class="copy" slot="button" size="mini" @click="copy">
          复制
        </van-button>
      </van-field>
      <van-field
        v-model="form.account"
        name="account"
        label="收款账号"
        placeholder="填写收款账号"
        :rules="[{ required: true, message: '请输入银行卡号' }]"
      >
        <van-button class="copy" slot="button" size="mini" @click="copy">
          复制
        </van-button>
      </van-field>
      <div style="margin: 16px;">
        <p class="pmt">
          <span>温馨提示：</span>如有任何疑问请联系 <a href="/kefu">客服</a>
        </p>
        <van-button class="big-btn" block native-type="submit">
          完 成
        </van-button>
        <p class="pmt center">请按照页面展示金额进行安全支付</p>
      </div>
    </van-form>
  </div>
</template>

<script>
export default {
  data() {
    return {
      form: {
        name: "张三",
        account: "1234 2356 6543 5524 332"
      }
    };
  },
  methods: {
    close() {
      this.$emit("close");
    },
    copy() {
      this.$toast.success("复制成功");
    },
    onSubmit(values) {
      console.log("submit", values);
      this.$toast.success("添加成功");
      this.close();
    }
  }
};
</script>

<style lang="scss" scoped>
.recharge {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  background-color: #fff;
  padding: 20px 15px;
  span {
    &:nth-child(1) {
      color: #747474;
      font-size: 14px;
      padding-bottom: 5px;
    }
    &:nth-child(2) {
      font-size: 200%;
      font-weight: 600;
    }
    &:nth-child(3) {
      margin-bottom: 8px;
      padding: 2px 5px;
      color: #fff;
      background-color: #eb7875;
      border-radius: 7px;
    }
  }
}
.info {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
  color: #767676;
  font-size: 120%;
  img {
    width: 80px;
    margin-top: 10px;
  }
}
.pmt {
  color: #767676;
  margin-bottom: 30px;
  span,
  a {
    color: #eb7875;
  }
  &.center {
    text-align: center;
    margin-top: 10px;
  }
}
.copy {
  color: #5aa4ff !important;
  text-decoration: underline;
  border-color: transparent !important;
}
</style>
